package com.zjitc.chapter08.advice;

import org.aspectj.lang.JoinPoint;

public class XmlAdvice {
    public void before(JoinPoint joinPoint) {
        System.out.println("前置通知");
        System.out.println("目标类:" + joinPoint.getTarget());
        System.out.println("目标方法:" + joinPoint.getSignature().getName());
    }
    public void afterReturning(JoinPoint joinPoint) {
        System.out.println("后置通知");
        System.out.println("目标类:" + joinPoint.getTarget());
        System.out.println("目标方法:" + joinPoint.getSignature().getName());
    }
    public void afterThrowing() {
        System.out.println("异常通知");

    }
    public void after() {
        System.out.println("最终通知");

    }
    public void around(JoinPoint joinPoint) throws Throwable {
        System.out.println("环绕通知");
        System.out.println("目标类:" + joinPoint.getTarget());
        System.out.println("目标方法:" + joinPoint.getSignature().getName());
    }
}
